package com.sunshine.scw.base.dao.query;

import java.io.Serializable;

/**
 * 排序查询类
 * @author xiao
 * @version 1.0
 */
public class QueryOrder implements Serializable {

	private static final long serialVersionUID = 384988212536026856L;

	public static final int ORDER_ASC = 1, ORDER_DESC = 2;

	/**
	 * 属性名
	 */
	private String property;

	/**
	 * 操作运算符
	 */
	private int iOrder;

	public QueryOrder(String property, int iOrder) {
		this.property = property;
		this.iOrder = iOrder;
	}

	/**
	 * 以升序方式排序
	 */
	public static QueryOrder asc(String property) {
		return new QueryOrder(property, QueryOrder.ORDER_ASC);
	}

	/**
	 * 以降序方式排序
	 */
	public static QueryOrder desc(String property) {
		return new QueryOrder(property, QueryOrder.ORDER_DESC);
	}

	public String getProperty() {
		return property;
	}

	public int getiOrder() {
		return iOrder;
	}

}
